<?php
include '../../Config/config.php';
include '../../Config/conexion.php';

include '../../Model/Paper.php';

$EsAnonimo = $_POST["EsAnonimo"];
$paper_id = $_POST['paper_id'];
$Paper = Paper::Obtener($paper_id);

if($_FILES['PaperAnonimo']['name'] != ""){
	$PaperName = $paper_id."@".date('his').$_FILES['PaperAnonimo']['name'];
	$PaperFile = $_FILES['PaperAnonimo']['tmp_name'];
	move_uploaded_file($PaperFile, PAPERS.$PaperName);
	$Paper->ActualizarFilePaper($PaperName);
			
}

if($_FILES['AbstractAnonimo']['name'] != ""){
	$AbstractName = $paper_id."@".date('his').$_FILES['AbstractAnonimo']['name'];
	$AbstractFile = $_FILES['AbstractAnonimo']['tmp_name'];
	move_uploaded_file($AbstractFile, ABSTRACTF.$AbstractName);
	$Paper->ActualizarFileAbstract($AbstractName);
}



$Paper->VerificarAnonimato($EsAnonimo);
//echo "123";

//echo $PaperName;
header('Location:index.php');
exit();
?>